﻿@using CREAPA.UL.Web.Models;
@using CREAPA.UL.Web.HtmlHelpers
@model CREAPA.Dominio.Portaria

@{
    ViewBag.Title = "Detalhes";
}


<h2>Detalhes da Portaria</h2>

@{    
    var grid = new WebGrid(ViewBag.ListaPortaria); 
}


@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Detalhes</legend>
        <p>
            @Html.HiddenFor(model => model.Id)

         <div class="display-label">
             <b>@Html.DisplayNameFor(model => model.Id):</b>
             @Html.DisplayFor(model => model.Id)
         </div>
        </p>

        <p>
            <div class="editor-label">
                <b>@Html.DisplayNameFor(model => model.Numero):</b>
                 @Html.DisplayFor(model => model.Numero)/@Html.DisplayFor(model => model.Ano)
            </div>
        </p>

        <p>
            <div class="editor-label">
                <b>@Html.DisplayNameFor(model => model.DataPortaria):</b>
                @Html.DisplayFor(model => model.DataPortaria)
            </div>
        </p>
        <p>
        <p>
            <div class="editor-label">
                <b>@Html.DisplayNameFor(model => model.PessoaCadastrou):</b>
                @Html.DisableableDropDownList("PessoaCadastrou",null,null, new { id = "cbGender1", style = "width:150px;"})
            </div>

            <p>
        <p>
            <div class="editor-label">
                <b>@Html.DisplayNameFor(model => model.IdTipoPortaria):</b>
                @Html.DisplayFor(model => model.IdTipoPortaria)
            </div>
        </p>
        <p>
            <div class="editor-label">
                <b>@Html.DisplayNameFor(model => model.IdAssuntoPortaria):</b>
                @Html.DisplayFor(model => model.IdAssuntoPortaria)
            </div>
        </p>
        <p>
            <div class="display-label">
                <b>@Html.LabelFor(model => model.Descricao):</b>
            </div>
        </p>
        @Html.Raw(@ViewBag.Descricao)
        <p>

        <p>
            <div class="editor-label">
                <b>@Html.DisplayNameFor(model => model.PresidenteAssinou):</b>
                @Html.DisplayFor(model => model.PresidenteAssinou)
            </div>
        </p>

        <p>
            <div class="editor-label">
                <b>Histórico da Portaria:</b>
            </div>
            <div>
                @grid.GetHtml( tableStyle: "tableAO",
        alternatingRowStyle: "alternateAO",
        headerStyle: "headerAO",
        footerStyle: "footerAO",
        mode: WebGridPagerModes.FirstLast | WebGridPagerModes.NextPrevious,
        firstText: "Primeiro",
        previousText: "Anterior",
        nextText: "Próximo",
        lastText: "Último",columns: grid.Columns(
              grid.Column("DescTipoSituacao", header:"Situacao", format: @<text><center>@item.DescTipoSituacao</center></text>),
              grid.Column("Descricao", header:"Descrição", format: @<text><div style='width: 30em'>@item.Descricao</div></text>),
              grid.Column("Data", header:"Data de Cadastro", format: @<text><center>@item.Data</center></text>),
              grid.Column("PessoaCadastrou", header:"Cadastrado por", format: @<text><center>@item.PessoaCadastrou</center></text>)))
            </div>
        </p>

        <div>
        </div>

        <p>
            @Html.ActionLink("voltar", "Index",null,new { @class = "button" })
        </p>




    </fieldset>
<script type="text/javascript">
    $("#cb_Toggle").ready(function () {
        var $Gender = $("#cbGender1");

        $Gender.disableDropDownList();
    });
</script>

<script type="text/javascript">
    $("#cb_Toggle").ready(function () {
        var $Gender = $("#cbGender2");

        $Gender.disableDropDownList();
    });
</script>

<script type="text/javascript">
    $("#cb_Toggle").ready(function () {
        var $Gender = $("#cbGender3");

        $Gender.disableDropDownList();
    });
</script>

<script type="text/javascript">
    $("#cb_Toggle").ready(function () {
        var $Gender = $("#cbGender4");

        $Gender.disableDropDownList();
    });
</script>

<script type="text/javascript">
    $("#cb_Toggle").ready(function () {
        var $Gender = $("#cbGender5");

        $Gender.disableDropDownList();
    });
</script>

}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
